home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Utilities / Winter Shell 1.0d2 / Source / Libraries / ScrollBarLib / ScrollBarET.c next >
Encoding:
C/C++ Source or Header  |  1994-01-12  |  1.0 KB  |  51 lines  |  [TEXT/KAHL]

  1. /* event table functions, called from event library in response to
  2.     events
  3.     
  4.     93/10/18 aih - created */
  5.  
  6. #include "EventLib.h"
  7. #include "ScrollBarLib.h"
  8.  
  9. static EventTableType gEventTable;
  10.     
  11. static Boolean within(EventObjectType object, Point where)
  12. {
  13.     return(SBarWithin(object, where));
  14. }
  15.  
  16. static Boolean mousedown(EventObjectType object, EventRecord *event)
  17. {
  18.     SBarMouseDown(object, event);
  19.     return(true);
  20. }
  21.  
  22. static void update(EventObjectType object)
  23. {
  24.     SBarUpdate(object);
  25. }
  26.  
  27. static void activate(EventObjectType object, Boolean activate)
  28. {
  29.     SBarActivate(object, activate);
  30. }
  31.  
  32. static void resize(EventObjectType object, short dh, short dv)
  33. {
  34.     SBarResize(object, dh, dv);
  35. }
  36.  
  37. const /* EventTableType */ void *SBarEventTable(void)
  38. {
  39.     return(&gEventTable);
  40. }
  41.  
  42. void SBarEventTableRegister(void)
  43. {
  44.     gEventTable.focusWindow.within = within;
  45.     gEventTable.focusWindow.mousedown = mousedown;
  46.     gEventTable.window.update = update;
  47.     gEventTable.window.activate = activate;
  48.     gEventTable.window.resize = resize;
  49.     EventTableRegister(&gEventTable);
  50. }
  51.